package com.woshua.processkeepmodel;

import android.content.Intent;
import android.graphics.Typeface;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.text.style.StyleSpan;
import android.text.style.UnderlineSpan;
import android.view.View;
import android.widget.TextView;

import com.binaryfork.spanny.Spanny;
import com.woshua.processkeepmodel.style.BoldSpanStyle;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        TextView textView=findViewById(R.id.tv_title);
        TextView textViewTwo=findViewById(R.id.tv_title_two);

        Spanny spanny = new Spanny("Underline text", new UnderlineSpan())
                .append("Bold text", new StyleSpan(Typeface.BOLD))
                .append("Plain text");
        textView.setText(spanny);


        Spanny spannyTwo = new Spanny("Underline text", new UnderlineSpan())
                .append("Bold text", new BoldSpanStyle())
                .append("Plain text");
        textViewTwo.setText(spannyTwo);
    }

    public void onStartDoubleService(View view) {
        startService(new Intent(this,LocalService.class));
        startService(new Intent(this,RemoteService.class));
    }
}
